package com.locus.locus.client.widgets;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.locus.locus.client.dados.TweetWrapper;

public class WidgetBox extends Composite {

	private static WidgetBoxUiBinder uiBinder = GWT
			.create(WidgetBoxUiBinder.class);

	interface WidgetBoxUiBinder extends UiBinder<Widget, WidgetBox> {
	}

	@UiField
	Label nomeBox;
	@UiField
	FlexTable tweets;

	public WidgetBox(String nomeBox, List<TweetWrapper> tweets) {
		initWidget(uiBinder.createAndBindUi(this));
		
		int row = 0;
		
		//this.nomeBox.setText(nomeBox);
		this.tweets.setBorderWidth(1);
		for(TweetWrapper t:tweets){
			this.tweets.setWidget(row, 0, new WidgetTweet(t));
			row++;
		}
	}
}
